package com.netcracker.lab1.view;

import com.netcracker.lab1.controller.MusicTrackController;

/**
 * Created with IntelliJ IDEA.
 * User: nocturne
 * Date: 15.01.13
 * Time: 12:22
 * To change this template use File | Settings | File Templates.
 */
public class ConsoleView {

    private MusicTrackController mtc;

    public ConsoleView()  {
        mtc = new MusicTrackController();
    }

    public void showAllTrack() {
        for(int i = 0; i < mtc.getSizeLibrary(); i++) {
            if(mtc.findTrackById(i) != null) {
                System.out.println(mtc.findTrackById(i).getAuthor() + " - " + mtc.findTrackById(i).getTitle());
            } else {
                System.out.println("пустой трек " + mtc.findTrackById(i));
            }
        }
    }


    public void showTrackById(Integer id) {
        System.out.println(mtc.findTrackById(id).getAuthor() + " - " + mtc.findTrackById(id).getTitle());
    }

    public void getSizeLibrary() {
        System.out.println("Всего треков в библиотеке: " + mtc.getSizeLibrary());
    }




}
